
namespace Nadine
{
	typedef void (CALLBACK *PCALLBACKNDMENUDIALOGMODECHANGE) ( int nMODE );
	typedef void (CALLBACK *PCALLBACKNDMENUDIALOGBUTTONEVENT) ( int nButtonPressed );

	class NDMenuDialog :public NDBaseObject
	{
	private:
		struct sButtonInfo
		{
			NDVECTOR2	vCurrentPosition;
			NDVECTOR2	vTargetPosition;

			RECT		rc;

			int			nState; //0:normal, 1:mouse over, 2:mouse press

			float		fTargMouseOverAlpha;
			float		fCurrMouseOverAlpha;
			float		fTargNormalAlpha;
			float		fCurrNormalAlpha;

			NDUID		nFontID;
			std::string strFont;

			NDUID		nNormalTexID;
			NDUID		nMouseOverTexID;


		};

		struct sDialogInfo
		{
			float							fCurrWidth;
			float							fTargWidth;

			NDVECTOR2						vCurrentPosition;
			NDVECTOR2						vTargetPosition;

			int								nState; //0:hidden (left), 1:Model STATE (right), 2:AR STATE( left)

			NDUID							nBGTexID;

			CGrowableArray< sButtonInfo* >	myNormalButtons;
			CGrowableArray< sButtonInfo* >	myARButtons;


		};

		sDialogInfo							m_myDialog;

		//CBFUNC
		PCALLBACKNDMENUDIALOGMODECHANGE		m_pCBModeChange;
		PCALLBACKNDMENUDIALOGBUTTONEVENT	m_pCBButtonEvent;

		int m_nCurrWindowWidth;
		int m_nCurrWindowHeight;

		int m_nCurrMouseOverButton;
		int m_nMouseDownButtonID;


	protected:
		void animateButton(float fElapsedTime);
		void animateDialog(float fElapsedTime);

	public:
		explicit NDMenuDialog( NDArk* pArk );
		virtual ~NDMenuDialog() {}

		virtual void release();
		void initialize();

		void render( float fElapsedTime );
		
		void mouseMove(UINT nx, UINT nY);
		
		void mouseLButtonDown();
		void mouseLButtonUp();

		void mouseRButtonDown();
		void mouseRButtonUp();

		void setWindowSz( UINT nW, UINT nH );

		void setCurrMode(int nMode );
		int getCurrMode()
		{
			return m_myDialog.nState;
		}	

		//cb func.
		void setCallbackFunc(PCALLBACKNDMENUDIALOGMODECHANGE pCBMODECHANGE, PCALLBACKNDMENUDIALOGBUTTONEVENT pCBBUTTONEVENT);

	};


}